<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?>
<?php 
	$ci = & get_instance(); 
	$id = intval($this->input->post('id', FALSE));
	$typeArray = coinTypePackagesDataConfig();
?>
<?php if(!($id)): ?>
<form action="<?php echo site_url('admin/dataman/general/add_coin_packages_submit');?>" name="add_coin_packages_submit" id="add_coin_packages_submit" method="post" enctype="multipart/form-data" >
	
	<div class="grid2"><span class="bold">*Package:</span></div>
	<div class="grid6"><input type="text" maxlength="255" id="package" name="package" value="" class="std-input"/></div>
	<div class="grid2"><span class="bold red hidden" id="package_error">Required field.</span></div>
<div class="clrboth"></div>		
	<div class="grid2"><span class="bold">*Coin:</span></div>
	<div class="grid6"><input type="text" maxlength="20" id="coin" name="coin" value="" class="std-input"/></div>
	<div class="grid2"><span class="bold red hidden" id="coin_error">Required field.</span></div>
<div class="clrboth"></div>		
	<div class="grid2"><span class="bold">*Cost:</span></div>
	<div class="grid6"><input type="text" maxlength="20" id="cost" name="cost" value="" class="std-input"/> (INR)</div>
	<div class="grid2"><span class="bold red hidden" id="cost_error">Required field.</span></div>
<div class="clrboth"></div>	
	<div class="grid2"><span class="bold">Type:</span></div>
	<div class="grid6"><?php echo form_dropdown( 'type',
								$options = $typeArray,
								$selected = array(),
								"id='type'"
							);	?></div>
<div class="clrboth"></div>		
	<div class="grid2">&nbsp;</div>
	<div class="grid6"><input type="submit" class="button" /> <?php echo loader_image('id="loader_image" class="hidden"');?></div>
	<div class="clrboth"></div>	
	
</form>
<?php else:?>
<form action="<?php echo site_url('admin/dataman/general/add_coin_packages_submit');?>" name="add_coin_packages_submit" id="add_coin_packages_submit" method="post" enctype="multipart/form-data" >
	<?php 
		$COIN_PACKAGE = $ci->coin_packages_entity->init('id',$id);
	?>
	<input type="hidden" name="id" value="<?php echo $COIN_PACKAGE->getId(); ?>" />
	
	<div class="grid2"><span class="bold">*Package:</span></div>
	<div class="grid6"><input type="text" maxlength="255" id="package" name="package" value="<?php echo $COIN_PACKAGE->getPackage();?>" class="std-input"/></div>
	<div class="grid2"><span class="bold red hidden" id="package_error">Required field.</span></div>
<div class="clrboth"></div>		
	<div class="grid2"><span class="bold">*Coin:</span></div>
	<div class="grid6"><input type="text" maxlength="20" id="coin" name="coin" value="<?php echo $COIN_PACKAGE->getCoin();?>" class="std-input"/></div>
	<div class="grid2"><span class="bold red hidden" id="coin_error">Required field.</span></div>
<div class="clrboth"></div>		
	<div class="grid2"><span class="bold">*Cost:</span></div>
	<div class="grid6"><input type="text" maxlength="20" id="cost" name="cost" value="<?php echo $COIN_PACKAGE->getCost();?>" class="std-input"/> (INR)</div>
	<div class="grid2"><span class="bold red hidden" id="cost_error">Required field.</span></div>
<div class="clrboth"></div>	
	<div class="grid2"><span class="bold">Type:</span></div>
	<div class="grid6"><?php echo form_dropdown( 'type',
								$options = $typeArray,
								$selected = array($COIN_PACKAGE->getType()),
								"id='type'"
							);	?></div>
<div class="clrboth"></div>			
	<div class="grid2">&nbsp;</div>
	<div class="grid6"><input type="submit" class="button" /> <?php echo loader_image('id="loader_image" class="hidden"');?></div>
	<div class="clrboth"></div>	
	
</form>
<?php endif;?>